package zxs.sino.elite.hub.enums.message;

import zxs.sino.elite.hub.enums.BaseEnum;

/**
 * 消息状态定数
 *
 * @author zhang
 */
public enum MessageStatus implements BaseEnum<Integer> {

    DELIVERED(1, "已送达"),
    SENT(2, "已发送"),
    READ(3, "已读");

    private final int code;
    private final String value;

    MessageStatus(int code, String value) {
        this.code = code;
        this.value = value;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    @Override
    public String getValue() {
        return value;
    }

    public static boolean isDelivered(Integer code) {
        return BaseEnum.isType(MessageStatus.class, code, DELIVERED);
    }

    public static boolean isSent(Integer code) {
        return BaseEnum.isType(MessageStatus.class, code, SENT);
    }

    public static boolean isRead(Integer code) {
        return BaseEnum.isType(MessageStatus.class, code, READ);
    }
}
